package cc.spider.model;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class FlowData {

    /**
     * 请求的配置信息
     */
    private final TaskInfo taskInfo;

    /**
     * 响应的结果信息
     */
    private final ResultInfo resultInfo;

    /**
     * 下一步的请求信息
     */
    private List<TaskInfo> nextTaskInfos = new ArrayList<>();


    /**
     * 提取出来的数据
     */
    private Map<String, Object> fields = new LinkedHashMap<>();

    public FlowData(TaskInfo taskInfo, ResultInfo resultInfo){
        this.taskInfo = taskInfo;
        this.resultInfo = resultInfo;
    }

    public Map<String, Object> getFields() {
        return fields;
    }

    public void setFields(Map<String, Object> fields) {
        this.fields = fields;
    }

    public ResultInfo getResultInfo() {
        return resultInfo;
    }

    public TaskInfo getTaskInfo() {
        return taskInfo;
    }

    public void addNextTaskInfo(TaskInfo taskInfo){
        this.nextTaskInfos.add(taskInfo);
    }

    public List<TaskInfo> getNextTaskInfos(){
        return this.nextTaskInfos;
    }
}
